package main

import (
	"fmt"
	"ginlogger/config"
	"ginlogger/logger"
	"os"

	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
)

func main() {
	if len(os.Args) < 1 {
		return
	}

	if err := config.Init(os.Args[1]); err != nil {
		panic(err)
	}
	// init logger
	if err := logger.InitLogger(config.Conf.LogConfig); err != nil {
		fmt.Printf("init logger failed, err:%v\n", err)
		return
	}
	gin.SetMode(config.Conf.Mode)

	zap.L().Info("this is hello func", zap.String("user", "name"), zap.Int("age", 12))
}
